﻿@model SMECustomerWebsite.Models.ViewModels.SalePerformance.SaleContestRankingViewModel
@Html.Action("SubMenuSaleContestRanking", "System")
<div class="row">
    <div class="col-md-12">
        <div class="x_panel">
            <div class="x_title">
                @Html.Action("SubMenuSaleContestRankingBack", "System")
                <h2>@SMECustomerWebsite.Core.Resources.Resource.SaleContestRegionRanking @Model.SaleContestRecord.SaleContestName</h2>
                <ul class="nav navbar-right panel_toolbox">
                    @Html.Action("BusinessDateInfo", "System", new { name = "TBL_SALE_CONTEST_BIL_AWARD_RAW" })
                    <li>
                        <a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <div class="col-md-6 cm-search-box">
                    <a href="/ProductHandbook/SaleContestInfo?salecontest=@Request.QueryString["salecontest"]" class="btn btn-success right sme-form-export">Xem thông tin chương trình</a>
                </div>
                <table id="sp-deposit" class="table table-bordered table-striped jambo_table custom_table" style="width:100% !important">
                    <thead class="headings">
                        <tr>
                            <th class="column-title">Nhóm vùng</th>
                            <th class="column-title">@SMECustomerWebsite.Core.Resources.Resource.RankHeader</th>
                            <th class="column-title">@SMECustomerWebsite.Core.Resources.Resource.MSBONameHeader</th>
                            <th class="column-title">@SMECustomerWebsite.Core.Resources.Resource.EligbelSaleContestHeader</th>
                            <th class="column-title">MỨC ĐẠT</th>
                        </tr>
                    </thead>
                    <tbody></tbody>
                </table>
                @Html.Partial("SaleContestSumary", Model.SaleContestRecord)
            </div>
        </div>
    </div>
</div>

@section scripts
{
    <script src="~/Scripts/tableeditable/dataTables.rowsGroup.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var table = $('#sp-deposit').DataTable({
                "order": [[0, 'asc']],
                "bServerSide": true,
                "bProcessing": true,
                "responsive": true,
                "bAutoWidth": false,
                "aLengthMenu": [10, 30, 50, 100],
                "pageLength": 10,
                rowsGroup: [0],
                //"bProcessing": true,
                "sAjaxSource": '@Url.Action("SaleContestRankingRegionData", "SalePerformance")' + '?salecontest=@Request.QueryString["salecontest"]',
                "fnServerData": function (sSource, aoData, fnCallback) {
                    $.ajax({
                        "dataType": 'json',
                        "type": "POST",
                        "url": sSource,
                        "data": aoData,
                        "success": fnCallback
                    });
                },
                "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'dataTables_wrapper'ip>>",
                "aoColumns": [
                            { "sName": "CIF", "className": 'column-title', "bSortable": false },
                            { "sName": "NAME", "className": 'column-title', "bSortable": false },
                            { "sName": "DATE OPEN", "bSortable": false },
                            { "sName": "VPB INDUSTRY", "className": 'column-title', "bSortable": false },
                            { "sName": "DATE OPEN", "className": 'column-title', "bSortable": false }, ],
                "aoColumnDefs": [],
                "drawCallback": function (settings) {
                    $('table.custom_table th').removeClass().addClass('column-title');
                }
            });

        });
    </script>
}